package com.tuozixuan.forest.condition;

import java.io.IOException;

import com.dtflys.forest.callback.RetryWhen;
import com.dtflys.forest.http.ForestRequest;
import com.dtflys.forest.http.ForestResponse;

public class RetryCondition implements RetryWhen {

	@Override
	public boolean retryWhen(ForestRequest req, ForestResponse res) {
		
		Throwable throwable = res.getException();
		return throwable != null && throwable instanceof IOException;
	}

}
